package com.tinyseed.emcp.api.basicdata.repository;

import com.tinyseed.emcp.api.basicdata.domain.ProducePollute;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/***
 * @ClassName: ProducePolluteRepository
 * @Description: TODO
 * @Auther: Harlan.Xiong
 * @Date: 2019-12-1 0:06
 * @version : V1.0
 */
public interface ProducePolluteRepository extends JpaRepository<ProducePollute, Long>, JpaSpecificationExecutor<ProducePollute> {

    @Transactional
    public void deleteByProduceId(Long produceId);

    @Transactional
    public void deleteByProduceIdAndPolluteId(Long produceId, Long polluteId);

    public List<ProducePollute> findAllByProduceId(Long produceId);

    public List<ProducePollute> findAllByPolluteId(Long polluteId);
}
